﻿using System;

using Microsoft.WowAddonStudio.Lua.Model;
using Microsoft.WowAddonStudio.Lua.Parser;

namespace Microsoft.WowAddonStudio.Lua.Loaders
{
    public class ParserDocumentationLoader : DocumentationLoader
    {
        private readonly DocumentationParser parser;

        public ParserDocumentationLoader(DocumentationParser parser)
        {
            if (parser == null)
                throw new ArgumentNullException("parser");

            this.parser = parser;
        }

        /// <summary>
        /// Loads the documentation.
        /// </summary>
        /// <returns>
        /// An instance of the <see cref="DocumentationScope"/> class.
        /// </returns>
        public override DocumentationScope LoadDocumentation()
        {
            return parser.GlobalScope;
        }
    }
}
